package com.centling.smartSealForPhone.utils;

import android.os.Environment;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * 通过uri 获取文件的路径，因为版本不同获取的方式也不一样
 * Created by Rein.li on 2015/12/9.
 */
@SuppressWarnings("ResultOfMethodCallIgnored")
public class FilePathUtils {

    public static File getImageFile() {
        File myDir = new File(Environment.getExternalStorageDirectory(), "smart_seal");
        if (!myDir.exists()) {
            myDir.mkdirs();
        }
        String myName = new SimpleDateFormat("yyyyMMddHHmmss", Locale.CHINA).format(
                new Date()) + ".jpg";
        return new File(myDir, myName);
    }
}
